<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>UserInfo</title>
    <style>
      a {
        text-decoration: none;
      }
    </style>
  </head>
  <body>
    <div>
      <h1>USER INFO</h1>
    </div>
    {% comment %} 添加用户 {% endcomment %}
    <div>
      <form method="post" action="/user/info/">
        {% csrf_token %}
        <input type="text" name="user" placeholder="username" />
        <input type="text" name="pwd" placeholder="password" />
        <input type="text" name="age" placeholder="age" />
        <input type="submit" value="submit" />
      </form>
    </div>
    {% comment %} 用户列表 {% endcomment %}
    <div style="padding-top: 10px">
      <table border="1">
        <thead>
          <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Password</th>
            <th>Age</th>
            <th>operate</th>
          </tr>
        </thead>
        <tbody>
          {% for obj in info_list %}
          <tr>
            <td>{{obj.id}}</td>
            <td>{{obj.name}}</td>
            <td>{{obj.password}}</td>
            <td>{{obj.age}}</td>
            <td>
              {% comment %} <a href="/user/delete/?nid={{obj.id}}">delete</a> {% endcomment %}
              <a href="/user/info/?nid={{obj.id}}">delete</a>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </body>
</html>
